package edu.nf.takeoutdemo.web.user;

import edu.nf.takeoutdemo.commons.base.BaseController;
import edu.nf.takeoutdemo.commons.result.Result;
import edu.nf.takeoutdemo.model.entity.Category;
import edu.nf.takeoutdemo.service.CategoryService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 *
 * @author zjl
 * @date 2025/10/28
 */
@RestController("userCategoryController")
@RequestMapping("/user/category")
@Slf4j
@RequiredArgsConstructor
public class CategoryController extends BaseController {
    private final CategoryService categoryService;
    @GetMapping("/list")
    public Result<List<Category>> list(){
        List<Category> list = categoryService.categoryAllList();
        return success(list);
    }
}
